package cn.wolfcode.luowowo.flight.service.impl;

import cn.wolfcode.luowowo.flight.domain.AirTicketDetail;
import cn.wolfcode.luowowo.flight.mapper.AirTicketDetailMapper;
import cn.wolfcode.luowowo.flight.query.AirTicketDetailQuery;
import cn.wolfcode.luowowo.flight.service.IAirTicketDetailService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class AirTicketDetailServiceImpl implements IAirTicketDetailService {

    @Autowired
    private AirTicketDetailMapper airTicketDetailMapper;

    @Override
    public PageInfo query(AirTicketDetailQuery qo) {

        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize(),qo.getOrderby());
        List<AirTicketDetail> list = airTicketDetailMapper.selectForList(qo);
        return new PageInfo(list);
    }

    @Override
    public AirTicketDetail queryById(Long id) {
        return airTicketDetailMapper.selectByPrimaryKey(id);
    }
}
